import i18next from "i18next"

export const v0Template = {
	node_id: "MAGIC-FLOW-NODE-6753cb5235e676-30935789",
	debug: false,
	name: "LLM Chat",
	description: "",
	node_type: 2,
	meta: [],
	params: {
		model: "gpt-4o-global",
		system_prompt: {
			id: "component-6753cb5235e78",
			version: "1",
			type: "value",
			structure: {
				type: "expression",
				const_value: null,
				expression_value: null,
			},
		},
		user_prompt: {
			id: "component-6753cb5235ea2",
			version: "1",
			type: "value",
			structure: {
				type: "expression",
				const_value: null,
				expression_value: null,
			},
		},
		model_config: {
			auto_memory: true,
			max_record: 50,
			temperature: 0.5,
		},
		tools: [],
		option_tools: [],
		knowledge_config: {
			operator: "developer",
			knowledge_list: [
				{
					knowledge_code: "",
					knowledge_type: 2,
					business_id: "",
					name: "",
					description: "",
				},
			],
			limit: 5,
			score: 0.4,
		},
		messages: {
			id: "component-6753cb5235ec6",
			version: "1",
			type: "form",
			structure: {
				type: "array",
				key: "root",
				sort: 0,
				title: i18next.t("common.historyMessages", { ns: "flow" }),
				description: "",
				required: null,
				value: null,
				encryption: false,
				encryption_value: null,
				items: {
					type: "object",
					key: "messages",
					sort: 0,
					title: i18next.t("common.historyMessages", { ns: "flow" }),
					description: "",
					required: ["role", "content"],
					value: null,
					encryption: false,
					encryption_value: null,
					items: null,
					properties: {
						role: {
							type: "string",
							key: "role",
							sort: 0,
							title: i18next.t("common.role", { ns: "flow" }),
							description: "",
							required: null,
							value: null,
							encryption: false,
							encryption_value: null,
							items: null,
							properties: null,
						},
						content: {
							type: "string",
							key: "content",
							sort: 1,
							title: i18next.t("common.content", { ns: "flow" }),
							description: "",
							required: null,
							value: null,
							encryption: false,
							encryption_value: null,
							items: null,
							properties: null,
						},
					},
				},
				properties: null,
			},
		},
	},
	next_nodes: [],
	input: null,
	output: {
		widget: null,
		form: {
			id: "component-6753cb5235f3e",
			version: "1",
			type: "form",
			structure: {
				type: "object",
				key: "root",
				sort: 0,
				title: "root节点",
				description: "",
				required: ["text", "use_tools"],
				value: null,
				encryption: false,
				encryption_value: null,
				items: null,
				properties: {
					use_tools: {
						type: "array",
						key: "use_tools",
						sort: 0,
						title: "使用到的工具",
						description: "",
						required: null,
						value: null,
						encryption: false,
						encryption_value: null,
						items: {
							type: "object",
							key: "",
							sort: 0,
							title: "工具详情",
							description: "",
							required: [],
							value: null,
							encryption: false,
							encryption_value: null,
							items: null,
							properties: {
								tool_name: {
									type: "string",
									key: "tool_name",
									sort: 0,
									title: "工具名称",
									description: "",
									required: null,
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
								success: {
									type: "boolean",
									key: "success",
									sort: 1,
									title: "是否成功",
									description: "",
									required: null,
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
								error_message: {
									type: "string",
									key: "error_message",
									sort: 2,
									title: "错误信息",
									description: "",
									required: null,
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
								arguments: {
									type: "object",
									key: "arguments",
									sort: 3,
									title: "工具参数",
									description: "",
									required: [],
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
								call_result: {
									type: "string",
									key: "call_result",
									sort: 4,
									title: "调用结果",
									description: "",
									required: null,
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
								elapsed_time: {
									type: "string",
									key: "elapsed_time",
									sort: 5,
									title: "耗时",
									description: "",
									required: null,
									value: null,
									encryption: false,
									encryption_value: null,
									items: null,
									properties: null,
								},
							},
						},
						properties: null,
					},
					text: {
						type: "string",
						key: "text",
						sort: 1,
						title: "LLM 响应文本",
						description: "",
						required: null,
						value: null,
						encryption: false,
						encryption_value: null,
						items: null,
						properties: null,
					},
				},
			},
		},
	},
	system_output: null,
}
